/**
 * 
 */
package com.demo2do.boyle.client.handler.impl;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.demo2do.boyle.client.Constant;

/**
 * @author Wilson
 *
 */
public class CookieHandlerMockImpl extends CookieHandlerImpl {

    private static final Logger logger = LoggerFactory.getLogger(CookieHandlerMockImpl.class);

    /*
     * (non-Javadoc)
     * @see com.demo2do.boyle.client.handler.CookieHandler#getCookie(java.lang.String, javax.servlet.http.HttpServletRequest)
     */
    public String getCookie(String name, HttpServletRequest request) {
        if(name.equals(Constant.COOKIE_OPEN_ID)) {
            logger.info("getCookie(): use mock openid[MOCK_OPEN_ID]");
            return "MOCK_OPEN_ID";
        } else {
            return super.getCookie(name, request);
        }
    }

}
